package util

import (
	json "github.com/json-iterator/go"
	"gpt-api/framework/log"
)

func DecodeStrToArr(str string) []string {
	arr := make([]string, 0)
	if len(str) == 0 {
		return arr
	}

	err := json.UnmarshalFromString(str, &arr)
	if err != nil {
		log.Error("decode err => " + str + ", err => " + err.Error())
	}

	return arr
}
